package com.yzh.design.demo.factory.impl;

import com.alibaba.fastjson.JSON;
import com.yzh.design.demo.ICommodity;
import com.yzh.design.demo.card.IQYCardService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Map;

public class CardCommodityService implements ICommodity {
    private Logger logger = LoggerFactory.getLogger(CardCommodityService.class);
    private IQYCardService service = new IQYCardService();
    @Override
    public void sendCommodity(String Uid, String commodityId, String bizId, Map<String, String> extMap) {
        service.grantToken(queryNumber(), commodityId);

        logger.info("请求参数[爱奇艺兑换卡] => uId：{} commodityId：{} bizId：{} extMap：{}", Uid, commodityId, bizId, JSON.toJSON(extMap));
        logger.info("测试结果[爱奇艺兑换卡]：success");
    }

    private String queryNumber() {
        return "15663186666";
    }
}
